#include <iostream>
#include <sstream>
#include <vector>
#include "shape.h"
#include "box.h"
#include "cylinder.h"

using namespace std;

int main()
{
	{
		int n=0;
		istringstream iss1("(shape,10,20)");
		istringstream iss2("(shape two, 30, 40  )");
		istringstream iss3("(box, 30, 40 \t,1\n,2,3 \n\t)");
		istringstream iss4("(cylinder, 90, 100, 110,120 )");
		shape s1("s1",1,2);
		shape s2;
		box b1("b1",3,2,1),b2;
		cylinder c1("c1",6,7),c2;

		cout << endl << endl;
		cout << s1<< endl;
		cout << b1<< endl;
		cout << c1<< endl;
		
		iss1 >> s1;
		iss2 >> s2;

		cout << endl << endl;
		cout << s1 << endl;
		cout << s2 << endl;
		
		iss3 >> b2;
		iss4 >> c2;
		cout << endl << endl;
		cout << b2 << endl;
		cout << c2 << endl;

		cout << "Volym b1+b2=" << b1+b2 << endl;
		cout << "Volym b1+b2=" << operator+(b1,b2) << endl;
		cout << "Volym b1+b2=" << b1.operator+(b2) << endl;
		cout << "Volym 10.0+b2=" << 10.0+b2 << endl;
		//cout << "Volym b2+10.0=" << b2+10.0 << endl; // Finns ingen operator+(box,double)

		cout << "Typomvandling (double) box = " << (double)b2 << endl;
		cout << "Typomvandling double(box) = " << double(b2) << endl;
		cout << "Typomvandling static_cast<double> = " << static_cast<double>(b2) << endl;

	}


	system("PAUSE");
	return 0;
}

